<template>
  <div class="dashboard-container">
    <div class="dashboard-text" style="margin-bottom: 15px;">
      <el-row>
        <el-col :span="8">
          <div class="demo-input-suffix">
            <span style="font-size: 14px;width: 15%;display: inline-block;">商户名称：</span>
            <el-input v-model="input" placeholder="请输入内容" style="width: 50%;"></el-input>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="demo-input-suffix">
            <span style="font-size: 14px;width: 15%;display: inline-block;">商户ID：</span>
            <el-input v-model="input" placeholder="请输入内容" style="width: 50%;"></el-input>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="demo-input-suffix">
            <span style="font-size: 14px;width: 15%;display: inline-block;">物料名称：</span>
            <el-input v-model="input" placeholder="请输入内容" style="width: 50%;"></el-input>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <div class="demo-input-suffix">
            <span style="font-size: 14px;width: 15%;display: inline-block;">店铺名称：</span>
            <el-input v-model="input" placeholder="请输入内容" style="width: 50%;"></el-input>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="demo-input-suffix">
            <span style="font-size: 14px;width: 15%;display: inline-block;">审核状态：</span>
            <el-select v-model="value" placeholder="请选择" style="width: 50%;">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
          </div>
        </el-col>
        <el-col :span="8" style="padding-left: 82px;">
            <el-button type="primary" style="width: 20%;">搜索</el-button>
            <el-button style="width: 20%;">重置</el-button>
        </el-col>
      </el-row>
    </div>
    <div class="dashboard-text" style="min-height: 695px;">
      <el-row style="margin-bottom: 15px;line-height: 30px;">
        <el-col :span="12">
          <span style="font-size: 18px;font-weight: bold;">品牌介绍</span>
        </el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button type="primary" style="width: 13%;">添加</el-button>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-table
              :data="tableData"
              border
              style="width: 100%">
              <el-table-column
                prop="date"
                align="center"
                label="商户名称">
              </el-table-column>
              <el-table-column
                prop="name"
                align="center"
                label="商户ID">
              </el-table-column>
              <el-table-column
                prop="address"
                align="center"
                label="店铺名称">
              </el-table-column>
              <el-table-column
                prop="date"
                align="center"
                label="店铺ID">
              </el-table-column>
              <el-table-column
                prop="address"
                align="center"
                label="物料名称">
              </el-table-column>
              <el-table-column
                prop="address"
                align="center"
                label="物料ID">
              </el-table-column>
              <el-table-column
                prop="address"
                align="center"
                label="物料类型">
              </el-table-column>
              <el-table-column
                prop="name"
                align="center"
                label="审核状态">
              </el-table-column>
              <el-table-column
                prop="address"
                align="center"
                label="拒绝原因">
              </el-table-column>
              <el-table-column
                label="操作"
                align="center">
                <template slot-scope="scope">
                  <el-button type="text" size="small">编辑</el-button>
                  <el-button @click="handleClick(scope.row)" type="text" size="small">下线</el-button>
                  <el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
                  <el-button @click="handleClick(scope.row)" type="text" size="small">更新状态</el-button>
                </template>
              </el-table-column>
            </el-table>
        </el-col>
        </el-row>
        <el-row style="margin: 25px 0 15px;line-height: 26px;text-align: right;">
          <el-col :span="24">
            <div class="block">
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage4"
                :page-sizes="[100, 200, 300, 400]"
                :page-size="100"
                layout="total, sizes, prev, pager, next, jumper"
                :total="400">
              </el-pagination>
            </div>
          </el-col>
        </el-row>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  methods: {
    handleClick(row) {
      console.log(row);
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    }
  },
  data() {
    return {
      value1: true,
      currentPage4: 1,
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }],
      input: '',
      options: [{
        value: '选项1',
        label: '黄金糕'
      }, {
        value: '选项2',
        label: '双皮奶'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }],
      value: ''
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 15px;
  }
  &-text {
    padding: 15px;
    font-size: 30px;
    line-height: 46px;
    background-color: #fff;
  }
}
</style>
